package com.fuqi.android.zhongcai.base.view.activity;


import android.util.Log;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;

import com.fuqi.android.zhongcai.R;
import com.fuqi.android.zhongcai.base.request.result.ProductIntroResult;

import butterknife.Bind;

public class GongYiDetailActivity extends BaseActivity {
    @Bind(R.id.wv_content)
    WebView webview;
//    @Bind(R.id.tv_content)
//    TextView mTview;
    private ProductIntroResult data;

    @Override
    public void initView() {

    }
    @Override
    public void initListener() {
        Log.e("ccqx",data.getDetail());

        webview.getSettings().setJavaScriptEnabled(true);
        webview.addJavascriptInterface(this, "javatojs");
//        webview.loadData(data.getDetail(), "text/html", "UTF-8") ;


//        RichText.from(data.getDetail()).async(true).into(mTview);

        webview.loadUrl("file:///android_asset/html/private.html");
    }

    @JavascriptInterface
    public String getPrivate() {
        return data.getDetail();
    }

    @Override
    public void initData() {
        data = (ProductIntroResult) getIntent().getSerializableExtra("data");
        titleBar.setTitle(data.getProName());

    }

    @Override
    public boolean hasTitleBar() {
        return true;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_gong_yi_detail;
    }
}
